# include <bits/stdc++.h>
using namespace std;

char a[102], b[102];
int x[102], y[102];
bool f;

int main() { 
# ifndef LOCAL
    freopen("sub.in", "r", stdin);
    freopen("sub.out", "w", stdout);
# endif
    scanf("%s%s", a, b);
    int la = strlen(a), lb = strlen(b);
    for(int i = 0; i < max(la, lb); i++) { 
        if(a[i]) x[i + 1] = a[la - 1 - i] - '0';
        if(b[i]) y[i + 1] = b[lb - 1 - i] - '0';
    }
    for(int i = max(la, lb); i >= 1; i--) { 
        if(y[i] > x[i]) { 
            f = 1;
            swap(x, y);
            break;
        } else if(x[i] > y[i]){ 
            break;
        }
    }
    
    for(int i = 1; i <= 100; i++) { 
        x[i] -= y[i];
        if(x[i] < 0) x[i] += 10, x[i + 1]--;
        if(x[i] >= 10) x[i] -= 10, x[i + 1]++;
    }
    bool flag = 0;
    if(f) cout << '-';
    for(int i = 100; i >= 1; i--) { 
        if(x[i] || flag) { 
            flag = 1;
            cout << x[i];
        }
    }
    if(!flag) cout << 0;
}
